#####################Written by Darcey S @ FileWave 3/30/2015#########################

########DON'T MODIFY BELOW THIS LINE##############################################

# Environment variables used are listed below
# These should be set in the 'Get Info > Executable tab of this Fileset
# $user
# $password
# $domain
# $ou


$pass = ConvertTo-SecureString $Env:password -AsPlainText -Force
$DomainCred = New-Object System.Management.Automation.PSCredential $Env:user, $pass
Add-Computer -DomainName $Env:domain -Credential $DomainCred -OUPath ($Env:ou)

Remove-Item $MyINvocation.InvocationName
Restart-Computer -Force

